import numpy as np
(kai_prise,gao_price,di_price,shou_price) = np.loadtxt('stock.csv',delimiter=',',usecols=(5,3,4,2),unpack=True)

kai_prise= '开盘价',np.mean(kai_prise),np.median(kai_prise),np.std(kai_prise),np.var(kai_prise)
gao_price= np.mean(gao_price),np.median(gao_price),np.std(gao_price),np.var(gao_price)
di_price=np.mean(di_price),np.median(di_price),np.std(di_price),np.var(di_price)
shou_price= np.mean(shou_price),np.median(shou_price),np.std(shou_price),np.var(shou_price)

shuju = [kai_prise,gao_price,di_price,shou_price]
print(shuju)


# ,header="开盘价,最高价,最低价,收盘价"

np.savetxt("shuju.csv",shuju,delimiter=",",comments="",fmt="%.2f")
